﻿<UserControl 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ctl="clr-namespace:Microsoft.WVB.UI;assembly=Microsoft.WVB.UI"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
	d:DesignWidth="470" d:DesignHeight="510" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    x:Class="Microsoft.WVB.UI.EPGView3">
    <UserControl.Resources>
        <ctl:PositionCalcConverter x:Key="posCalc" />
        <ctl:WidthCalcConverter x:Key="widthCalc" />
        <ctl:TimeFormatConverter x:Key="timeCalc" />
        <LinearGradientBrush x:Key="greyFadeVert2" EndPoint="0.5,0.971" StartPoint="0.5,0.03">
            <GradientStop Color="#FFEAEAEA" Offset="0"/>
            <GradientStop Color="#FFFFFFFF" Offset="1"/>
        </LinearGradientBrush>
        <ImageBrush x:Key="hourtimeline" ImageSource="http://localhost:8080/images/epgicons/hour_timeline.png" />
        <Style x:Key="EPGButton" TargetType="Button" >
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <Grid.Resources>                              
                            </Grid.Resources>
                            <Border x:Name="EPGBorder" BorderThickness="1" Margin="0,1,1,0" BorderBrush="White" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">  
							
							<Border.Background>
                                                            		<LinearGradientBrush EndPoint="0.5,0.971" StartPoint="0.5,0.03">
                                                            			<GradientStop Color="#FFECECEC" Offset="1"/>
                                                            			<GradientStop Color="#FFF7F7F7" Offset="0"/>
                                                            		</LinearGradientBrush>
                                                            	</Border.Background>
																                          
                            <ContentPresenter x:Name="EPGPresenter"
                                Content="{TemplateBinding Content}" 
                                HorizontalAlignment="Left" 
                                Margin="5,0,0,0"
                                />
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="OpacityMask" Value="{StaticResource greyFadeVert2}"/>
        </Style>
        <ControlTemplate x:Key="ThumbControlTick" TargetType="Thumb">
        	<Grid Width="Auto" HorizontalAlignment="Stretch">
        		<vsm:VisualStateManager.VisualStateGroups>
        			<vsm:VisualStateGroup x:Name="CommonStates">
        				<vsm:VisualState x:Name="Normal"/>
        				<vsm:VisualState x:Name="MouseOver">
        					<Storyboard>
        						<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundMouseOver" Storyboard.TargetProperty="Opacity">
        							<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        						</DoubleAnimationUsingKeyFrames>
        						<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        							<SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
        						</ColorAnimationUsingKeyFrames>
        						<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        							<SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
        						</ColorAnimationUsingKeyFrames>
        						<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        							<SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
        						</ColorAnimationUsingKeyFrames>
        					</Storyboard>
        				</vsm:VisualState>
        				<vsm:VisualState x:Name="Pressed">
        					<Storyboard>
        						<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundPressed" Storyboard.TargetProperty="Opacity">
        							<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        						</DoubleAnimationUsingKeyFrames>
        						<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
        							<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
        						</DoubleAnimationUsingKeyFrames>
        						<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        							<SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
        						</ColorAnimationUsingKeyFrames>
        						<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        							<SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF"/>
        						</ColorAnimationUsingKeyFrames>
        						<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        							<SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF"/>
        						</ColorAnimationUsingKeyFrames>
        						<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
        							<SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF"/>
        						</ColorAnimationUsingKeyFrames>
        					</Storyboard>
        				</vsm:VisualState>
        				<vsm:VisualState x:Name="Disabled">
        					<Storyboard>
        						<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ThumbVisual" Storyboard.TargetProperty="Opacity">
        							<SplineDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
        						</DoubleAnimationUsingKeyFrames>
        					</Storyboard>
        				</vsm:VisualState>
        			</vsm:VisualStateGroup>
        		</vsm:VisualStateManager.VisualStateGroups>
        		<Grid Margin="0,1,0,1" x:Name="ThumbVisual" HorizontalAlignment="Stretch" Width="Auto">
        			<Rectangle x:Name="Background" Fill="#FF1F3B53" StrokeThickness="1" RadiusX="2" RadiusY="2" Opacity="1">
        				<Rectangle.Stroke>
        					<LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
        						<GradientStop Color="#FF818F99" Offset="1"/>
        						<GradientStop Color="#FFC2C9CE" Offset="0"/>
        						<GradientStop Color="#FFB3BBC1" Offset="0.35"/>
        						<GradientStop Color="#FF96A4B1" Offset="0.35"/>
        					</LinearGradientBrush>
        				</Rectangle.Stroke>
        			</Rectangle>
        			<Rectangle x:Name="BackgroundMouseOver" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        			<Rectangle x:Name="BackgroundPressed" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="2" RadiusX="2" RadiusY="2"/>
        			<Rectangle Margin="1" x:Name="BackgroundGradient" Stroke="#FFFFFFFF" StrokeThickness="1" RadiusX="1" RadiusY="1">
        				<Rectangle.Fill>
        					<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
        						<GradientStop Color="#FFFFFFFF" Offset="0"/>
        						<GradientStop Color="#F9FFFFFF" Offset="0.371"/>
        						<GradientStop Color="#E5FFFFFF" Offset="0.603"/>
        						<GradientStop Color="#C6FFFFFF" Offset="1"/>
        					</LinearGradientBrush>
        				</Rectangle.Fill>
        			</Rectangle>
        			<Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" Stroke="#FF6DBDD1" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
        		</Grid>
        	</Grid>
        </ControlTemplate>
        <Style x:Key="ScrollBarTick" TargetType="ScrollBar">
        	<Setter Property="MinWidth" Value="17"/>
        	<Setter Property="MinHeight" Value="17"/>
        	<Setter Property="IsTabStop" Value="False"/>
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="ScrollBar">
        				<Grid x:Name="Root" Height="46.5">
        					<Grid.Resources>
        						<ControlTemplate x:Key="RepeatButtonTemplate" TargetType="RepeatButton">
        							<Grid x:Name="Root" Background="Transparent">
        								<vsm:VisualStateManager.VisualStateGroups>
        									<vsm:VisualStateGroup x:Name="CommonStates">
        										<vsm:VisualState x:Name="Normal"/>
        									</vsm:VisualStateGroup>
        								</vsm:VisualStateManager.VisualStateGroups>
        							</Grid>
        						</ControlTemplate>
        						<ControlTemplate x:Key="HorizontalIncrementTemplate" TargetType="RepeatButton">
        							<Grid x:Name="Root">
        								<vsm:VisualStateManager.VisualStateGroups>
        									<vsm:VisualStateGroup x:Name="CommonStates">
        										<vsm:VisualState x:Name="Normal"/>
        										<vsm:VisualState x:Name="MouseOver">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Pressed">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
        													<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Disabled">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value=".7"/>
        												</DoubleAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        									</vsm:VisualStateGroup>
        								</vsm:VisualStateManager.VisualStateGroups>
        								<Rectangle x:Name="Background" Opacity="0" Fill="#FF1F3B53" StrokeThickness="1" RadiusX="2" RadiusY="2">
        									<Rectangle.Stroke>
        										<LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
        											<GradientStop Color="#FF647480" Offset="1"/>
        											<GradientStop Color="#FFAEB7BF" Offset="0"/>
        											<GradientStop Color="#FF919EA7" Offset="0.35"/>
        											<GradientStop Color="#FF7A8A99" Offset="0.35"/>
        										</LinearGradientBrush>
        									</Rectangle.Stroke>
        								</Rectangle>
        								<Rectangle x:Name="BackgroundAnimation" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        								<Rectangle Margin="1" x:Name="BackgroundGradient" Opacity="0" Stroke="#FFFFFFFF" StrokeThickness="1" RadiusX="1" RadiusY="1">
        									<Rectangle.Fill>
        										<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
        											<GradientStop Color="#FFFFFFFF" Offset="0.013"/>
        											<GradientStop Color="#F9FFFFFF" Offset="0.375"/>
        											<GradientStop Color="#E5FFFFFF" Offset="0.603"/>
        											<GradientStop Color="#C6FFFFFF" Offset="1"/>
        										</LinearGradientBrush>
        									</Rectangle.Fill>
        								</Rectangle>
        								<Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" Stroke="#FF6DBDD1" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
        								<Path Height="8" Width="4" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " Stretch="Uniform">
        									<Path.Fill>
        										<SolidColorBrush Color="#FF333333" x:Name="ButtonColor"/>
        									</Path.Fill>
        								</Path>
        								<Rectangle x:Name="DisabledElement" Opacity="0" Fill="#FFFFFFFF" RadiusX="2" RadiusY="2"/>
        							</Grid>
        						</ControlTemplate>
        						<ControlTemplate x:Key="HorizontalDecrementTemplate" TargetType="RepeatButton">
        							<Grid x:Name="Root">
        								<vsm:VisualStateManager.VisualStateGroups>
        									<vsm:VisualStateGroup x:Name="CommonStates">
        										<vsm:VisualState x:Name="Normal"/>
        										<vsm:VisualState x:Name="MouseOver">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundMouseOver" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Pressed">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundPressed" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
        													<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Disabled">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value=".7"/>
        												</DoubleAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        									</vsm:VisualStateGroup>
        								</vsm:VisualStateManager.VisualStateGroups>
        								<Rectangle x:Name="Background" Opacity="0" Fill="#FF1F3B53" StrokeThickness="1" RadiusX="2" RadiusY="2">
        									<Rectangle.Stroke>
        										<LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
        											<GradientStop Color="#FF647480" Offset="1"/>
        											<GradientStop Color="#FFAEB7BF" Offset="0"/>
        											<GradientStop Color="#FF919EA7" Offset="0.35"/>
        											<GradientStop Color="#FF7A8A99" Offset="0.35"/>
        										</LinearGradientBrush>
        									</Rectangle.Stroke>
        								</Rectangle>
        								<Rectangle x:Name="BackgroundMouseOver" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        								<Rectangle x:Name="BackgroundPressed" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        								<Rectangle Margin="1" x:Name="BackgroundGradient" Opacity="0" Stroke="#FFFFFFFF" StrokeThickness="1" RadiusX="1" RadiusY="1">
        									<Rectangle.Fill>
        										<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
        											<GradientStop Color="#FFFFFFFF" Offset="0.013"/>
        											<GradientStop Color="#F9FFFFFF" Offset="0.375"/>
        											<GradientStop Color="#E5FFFFFF" Offset="0.603"/>
        											<GradientStop Color="#C6FFFFFF" Offset="1"/>
        										</LinearGradientBrush>
        									</Rectangle.Fill>
        								</Rectangle>
        								<Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" Stroke="#FF6DBDD1" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
        								<Path Height="8" Width="4" Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z " Stretch="Uniform">
        									<Path.Fill>
        										<SolidColorBrush Color="#FF333333" x:Name="ButtonColor"/>
        									</Path.Fill>
        								</Path>
        								<Rectangle x:Name="DisabledElement" Opacity="0" Fill="#FFFFFFFF" RadiusX="2" RadiusY="2"/>
        							</Grid>
        						</ControlTemplate>
        						<ControlTemplate x:Key="VerticalIncrementTemplate" TargetType="RepeatButton">
        							<Grid x:Name="Root">
        								<vsm:VisualStateManager.VisualStateGroups>
        									<vsm:VisualStateGroup x:Name="CommonStates">
        										<vsm:VisualState x:Name="Normal"/>
        										<vsm:VisualState x:Name="MouseOver">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundMouseOver" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Pressed">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundPressed" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
        													<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Disabled">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value=".7"/>
        												</DoubleAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        									</vsm:VisualStateGroup>
        								</vsm:VisualStateManager.VisualStateGroups>
        								<Rectangle x:Name="Background" Opacity="0" Fill="#FF1F3B53" StrokeThickness="1" RadiusX="2" RadiusY="2">
        									<Rectangle.Stroke>
        										<LinearGradientBrush EndPoint="1,.5" StartPoint="0,.5">
        											<GradientStop Color="#FF647480" Offset="1"/>
        											<GradientStop Color="#FFAEB7BF" Offset="0"/>
        											<GradientStop Color="#FF919EA7" Offset="0.35"/>
        											<GradientStop Color="#FF7A8A99" Offset="0.35"/>
        										</LinearGradientBrush>
        									</Rectangle.Stroke>
        								</Rectangle>
        								<Rectangle x:Name="BackgroundMouseOver" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        								<Rectangle x:Name="BackgroundPressed" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        								<Rectangle Margin="1" x:Name="BackgroundGradient" Opacity="0" Stroke="#FFFFFFFF" StrokeThickness="1" RadiusX="1" RadiusY="1">
        									<Rectangle.Fill>
        										<LinearGradientBrush EndPoint="1,.7" StartPoint="0,.7">
        											<GradientStop Color="#FFFFFFFF" Offset="0.013"/>
        											<GradientStop Color="#F9FFFFFF" Offset="0.375"/>
        											<GradientStop Color="#E5FFFFFF" Offset="0.603"/>
        											<GradientStop Color="#C6FFFFFF" Offset="1"/>
        										</LinearGradientBrush>
        									</Rectangle.Fill>
        								</Rectangle>
        								<Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" Stroke="#FF6DBDD1" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
        								<Path Height="4" Width="8" Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z " Stretch="Uniform">
        									<Path.Fill>
        										<SolidColorBrush Color="#FF333333" x:Name="ButtonColor"/>
        									</Path.Fill>
        								</Path>
        								<Rectangle x:Name="DisabledElement" Opacity="0" Fill="#FFFFFFFF" RadiusX="2" RadiusY="2"/>
        							</Grid>
        						</ControlTemplate>
        						<ControlTemplate x:Key="VerticalDecrementTemplate" TargetType="RepeatButton">
        							<Grid x:Name="Root">
        								<vsm:VisualStateManager.VisualStateGroups>
        									<vsm:VisualStateGroup x:Name="CommonStates">
        										<vsm:VisualState x:Name="Normal"/>
        										<vsm:VisualState x:Name="MouseOver">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundMouseOver" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Pressed">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundPressed" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
        													<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Disabled">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledElement" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value=".7"/>
        												</DoubleAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        									</vsm:VisualStateGroup>
        								</vsm:VisualStateManager.VisualStateGroups>
        								<Rectangle x:Name="Background" Opacity="0" Fill="#FF1F3B53" StrokeThickness="1" RadiusX="2" RadiusY="2">
        									<Rectangle.Stroke>
        										<LinearGradientBrush EndPoint="1,.5" StartPoint="0,.5">
        											<GradientStop Color="#FF647480" Offset="1"/>
        											<GradientStop Color="#FFAEB7BF" Offset="0"/>
        											<GradientStop Color="#FF919EA7" Offset="0.35"/>
        											<GradientStop Color="#FF7A8A99" Offset="0.35"/>
        										</LinearGradientBrush>
        									</Rectangle.Stroke>
        								</Rectangle>
        								<Rectangle x:Name="BackgroundMouseOver" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        								<Rectangle x:Name="BackgroundPressed" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        								<Rectangle Margin="1" x:Name="BackgroundGradient" Opacity="0" Stroke="#FFFFFFFF" StrokeThickness="1" RadiusX="1" RadiusY="1">
        									<Rectangle.Fill>
        										<LinearGradientBrush EndPoint="1,.7" StartPoint="0,.7">
        											<GradientStop Color="#FFFFFFFF" Offset="0.013"/>
        											<GradientStop Color="#F9FFFFFF" Offset="0.375"/>
        											<GradientStop Color="#E5FFFFFF" Offset="0.603"/>
        											<GradientStop Color="#C6FFFFFF" Offset="1"/>
        										</LinearGradientBrush>
        									</Rectangle.Fill>
        								</Rectangle>
        								<Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" Stroke="#FF6DBDD1" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
        								<Path Height="4" Width="8" Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z " Stretch="Uniform">
        									<Path.Fill>
        										<SolidColorBrush Color="#FF333333" x:Name="ButtonColor"/>
        									</Path.Fill>
        								</Path>
        								<Rectangle x:Name="DisabledElement" Opacity="0" Fill="#FFFFFFFF" RadiusX="2" RadiusY="2"/>
        							</Grid>
        						</ControlTemplate>
        						<ControlTemplate x:Key="VerticalThumbTemplate" TargetType="Thumb">
        							<Grid>
        								<vsm:VisualStateManager.VisualStateGroups>
        									<vsm:VisualStateGroup x:Name="CommonStates">
        										<vsm:VisualState x:Name="Normal"/>
        										<vsm:VisualState x:Name="MouseOver">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundMouseOver" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Pressed">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundPressed" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
        													<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Disabled">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ThumbVisual" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
        												</DoubleAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        									</vsm:VisualStateGroup>
        								</vsm:VisualStateManager.VisualStateGroups>
        								<Grid Margin="1,0,1,0" x:Name="ThumbVisual">
        									<Rectangle x:Name="Background" Fill="#FF1F3B53" StrokeThickness="1" RadiusX="2" RadiusY="2">
        										<Rectangle.Stroke>
        											<LinearGradientBrush EndPoint="1,.5" StartPoint="0,.5">
        												<GradientStop Color="#FF818F99" Offset="1"/>
        												<GradientStop Color="#FFC2C9CE" Offset="0"/>
        												<GradientStop Color="#FFB3BBC1" Offset="0.35"/>
        												<GradientStop Color="#FF96A4B1" Offset="0.35"/>
        											</LinearGradientBrush>
        										</Rectangle.Stroke>
        									</Rectangle>
        									<Rectangle x:Name="BackgroundMouseOver" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        									<Rectangle x:Name="BackgroundPressed" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        									<Rectangle Margin="1" x:Name="BackgroundGradient" Stroke="#FFFFFFFF" StrokeThickness="1" RadiusX="1" RadiusY="1">
        										<Rectangle.Fill>
        											<LinearGradientBrush EndPoint="1,.7" StartPoint="0,.7">
        												<GradientStop Color="#FFFFFFFF" Offset="0"/>
        												<GradientStop Color="#F9FFFFFF" Offset="0.375"/>
        												<GradientStop Color="#E5FFFFFF" Offset="0.6"/>
        												<GradientStop Color="#C6FFFFFF" Offset="1"/>
        											</LinearGradientBrush>
        										</Rectangle.Fill>
        									</Rectangle>
        									<Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" Stroke="#FF6DBDD1" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
        								</Grid>
        							</Grid>
        						</ControlTemplate>
        						<ControlTemplate x:Key="HorizontalThumbTemplate" TargetType="Thumb">
        							<Grid>
        								<vsm:VisualStateManager.VisualStateGroups>
        									<vsm:VisualStateGroup x:Name="CommonStates">
        										<vsm:VisualState x:Name="Normal"/>
        										<vsm:VisualState x:Name="MouseOver">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundMouseOver" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Pressed">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundPressed" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
        													<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
        												</DoubleAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        												<ColorAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
        													<SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF"/>
        												</ColorAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        										<vsm:VisualState x:Name="Disabled">
        											<Storyboard>
        												<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ThumbVisual" Storyboard.TargetProperty="Opacity">
        													<SplineDoubleKeyFrame KeyTime="0:0:0" Value="0"/>
        												</DoubleAnimationUsingKeyFrames>
        											</Storyboard>
        										</vsm:VisualState>
        									</vsm:VisualStateGroup>
        								</vsm:VisualStateManager.VisualStateGroups>
        								<Grid Margin="0,1,0,1" x:Name="ThumbVisual">
        									<Rectangle x:Name="Background" Fill="#FF1F3B53" StrokeThickness="1" RadiusX="2" RadiusY="2">
        										<Rectangle.Stroke>
        											<LinearGradientBrush EndPoint=".5,1" StartPoint=".5,0">
        												<GradientStop Color="#FF818F99" Offset="1"/>
        												<GradientStop Color="#FFC2C9CE" Offset="0"/>
        												<GradientStop Color="#FFB3BBC1" Offset="0.35"/>
        												<GradientStop Color="#FF96A4B1" Offset="0.35"/>
        											</LinearGradientBrush>
        										</Rectangle.Stroke>
        									</Rectangle>
        									<Rectangle x:Name="BackgroundMouseOver" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        									<Rectangle x:Name="BackgroundPressed" Opacity="0" Fill="#FF448DCA" Stroke="#00000000" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
        									<Rectangle Margin="1" x:Name="BackgroundGradient" Stroke="#FFFFFFFF" StrokeThickness="1" RadiusX="1" RadiusY="1">
        										<Rectangle.Fill>
        											<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
        												<GradientStop Color="#FFFFFFFF" Offset="0.013"/>
        												<GradientStop Color="#F9FFFFFF" Offset="0.375"/>
        												<GradientStop Color="#E5FFFFFF" Offset="0.603"/>
        												<GradientStop Color="#C6FFFFFF" Offset="1"/>
        											</LinearGradientBrush>
        										</Rectangle.Fill>
        									</Rectangle>
        									<Rectangle Margin="1" x:Name="Highlight" IsHitTestVisible="false" Opacity="0" Stroke="#FF6DBDD1" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
        								</Grid>
        							</Grid>
        						</ControlTemplate>
        					</Grid.Resources>
        					<vsm:VisualStateManager.VisualStateGroups>
        						<vsm:VisualStateGroup x:Name="CommonStates">
        							<vsm:VisualState x:Name="Normal"/>
        							<vsm:VisualState x:Name="MouseOver"/>
        							<vsm:VisualState x:Name="Disabled">
        								<Storyboard>
        									<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity">
        										<SplineDoubleKeyFrame KeyTime="0" Value="0.5"/>
        									</DoubleAnimationUsingKeyFrames>
        								</Storyboard>
        							</vsm:VisualState>
        						</vsm:VisualStateGroup>
        					</vsm:VisualStateManager.VisualStateGroups>
        					<Grid x:Name="HorizontalRoot" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment" Height="18">
        						<Grid.ColumnDefinitions>
        							<ColumnDefinition Width="Auto"/>
        							<ColumnDefinition Width="Auto"/>
        							<ColumnDefinition Width="Auto"/>
        							<ColumnDefinition Width="*"/>
        							<ColumnDefinition Width="Auto"/>
        						</Grid.ColumnDefinitions>
        						<Rectangle Grid.ColumnSpan="5" Stroke="#00000000" StrokeThickness="1" RadiusX="1" RadiusY="1">
        							<Rectangle.Fill>
        								<LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
        									<GradientStop Color="#FF979797" Offset="0"/>
        									<GradientStop Color="#FFD6D6D6" Offset="0.469"/>
        									<GradientStop Color="#FF9F9F9F" Offset="1"/>
        									<GradientStop Color="#FFE9EEF4" Offset="0.679"/>
        								</LinearGradientBrush>
        							</Rectangle.Fill>
        						</Rectangle>
        						<Rectangle Grid.ColumnSpan="5" Fill="{TemplateBinding Background}" Stroke="#00000000" StrokeThickness="1" RadiusX="1" RadiusY="1"/>
        						<Rectangle Opacity=".375" Grid.ColumnSpan="5" StrokeThickness="1" RadiusX="1" RadiusY="1">
        							<Rectangle.Stroke>
        								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        									<GradientStop Color="#FFA3AEB9" Offset="0"/>
        									<GradientStop Color="#FF8399A9" Offset="0.375"/>
        									<GradientStop Color="#FF718597" Offset="0.375"/>
        									<GradientStop Color="#FF617584" Offset="1"/>
        								</LinearGradientBrush>
        							</Rectangle.Stroke>
        						</Rectangle>
        						<Rectangle Margin="1" Grid.ColumnSpan="5" RadiusX="1" RadiusY="1">
        							<Rectangle.Stroke>
        								<LinearGradientBrush EndPoint="0.5,.125" StartPoint=".5,.875">
        									<GradientStop Color="#33FFFFFF"/>
        									<GradientStop Color="#99FFFFFF" Offset="1"/>
        								</LinearGradientBrush>
        							</Rectangle.Stroke>
        						</Rectangle>
        						<RepeatButton Margin="1" x:Name="HorizontalSmallDecrease" Width="16" IsTabStop="False" Template="{StaticResource HorizontalDecrementTemplate}" Grid.Column="0" Interval="50"/>
        						<RepeatButton x:Name="HorizontalLargeDecrease" Width="0" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Column="1" Interval="50"/>
        						<Thumb MinWidth="18" x:Name="HorizontalThumb" Width="Auto" Background="{TemplateBinding Background}" Template="{StaticResource ThumbControlTick}" Grid.Column="2" HorizontalAlignment="Stretch"/>
        						<RepeatButton x:Name="HorizontalLargeIncrease" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Column="3" Interval="50"/>
        						<RepeatButton Margin="1" x:Name="HorizontalSmallIncrease" Width="16" IsTabStop="False" Template="{StaticResource HorizontalIncrementTemplate}" Grid.Column="4" Interval="50"/>
        						<Grid Height="24.375" x:Name="tick" Margin="0,0,0,-26" VerticalAlignment="Bottom" Grid.Column="2" d:LayoutOverrides="VerticalAlignment">
        							<Path Height="4" Margin="0,0,0,0" VerticalAlignment="Bottom" RenderTransformOrigin="0.5,0.5" Data="M10.125,10 L14.625,10 L12.4875,14.996875 z" Fill="#FF000000" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="1" HorizontalAlignment="Stretch" Width="7">
        								<Path.RenderTransform>
        									<TransformGroup>
        										<ScaleTransform/>
        										<SkewTransform/>
        										<RotateTransform Angle="180"/>
        										<TranslateTransform/>
        									</TransformGroup>
        								</Path.RenderTransform>
        							</Path>
        							<Path Margin="3,0.187,3,2.938" Data="M24.875,42.75 L24.875,33" Fill="#FF000000" Stretch="Fill" Stroke="#FF000000" StrokeThickness="1" d:LayoutOverrides="Width"/>
        						</Grid>
        					</Grid>
        					<Grid x:Name="VerticalRoot" Visibility="Collapsed" d:IsLocked="True">
        						<Grid.RowDefinitions>
        							<RowDefinition Height="Auto"/>
        							<RowDefinition Height="Auto"/>
        							<RowDefinition Height="Auto"/>
        							<RowDefinition Height="*"/>
        							<RowDefinition Height="Auto"/>
        						</Grid.RowDefinitions>
        						<Rectangle Grid.RowSpan="5" Stroke="#00000000" StrokeThickness="1" RadiusX="1" RadiusY="1">
        							<Rectangle.Fill>
        								<LinearGradientBrush EndPoint="0,0.5" StartPoint="1,0.5">
        									<GradientStop Color="#FFF4F6F7" Offset="0"/>
        									<GradientStop Color="#FFF0F4F7" Offset="0.344"/>
        									<GradientStop Color="#FFDFE3E6" Offset="1"/>
        									<GradientStop Color="#FFE9EEF4" Offset="0.527"/>
        								</LinearGradientBrush>
        							</Rectangle.Fill>
        						</Rectangle>
        						<Rectangle Opacity=".375" Grid.RowSpan="5" StrokeThickness="1" RadiusX="1" RadiusY="1">
        							<Rectangle.Stroke>
        								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        									<GradientStop Color="#FFA3AEB9" Offset="0"/>
        									<GradientStop Color="#FF8399A9" Offset="0.375"/>
        									<GradientStop Color="#FF718597" Offset="0.375"/>
        									<GradientStop Color="#FF617584" Offset="1"/>
        								</LinearGradientBrush>
        							</Rectangle.Stroke>
        						</Rectangle>
        						<Rectangle Margin="1" Grid.RowSpan="5" RadiusX="1" RadiusY="1">
        							<Rectangle.Stroke>
        								<LinearGradientBrush EndPoint="0.125,0.5" StartPoint="0.875,0.5">
        									<GradientStop Color="#33FFFFFF"/>
        									<GradientStop Color="#99FFFFFF" Offset="1"/>
        								</LinearGradientBrush>
        							</Rectangle.Stroke>
        						</Rectangle>
        						<RepeatButton Height="16" Margin="1" x:Name="VerticalSmallDecrease" IsTabStop="False" Template="{StaticResource VerticalDecrementTemplate}" Grid.Row="0" Interval="50"/>
        						<RepeatButton Height="0" x:Name="VerticalLargeDecrease" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Row="1" Interval="50"/>
        						<Thumb Height="18" MinHeight="18" x:Name="VerticalThumb" Template="{StaticResource VerticalThumbTemplate}" Grid.Row="2"/>
        						<RepeatButton x:Name="VerticalLargeIncrease" IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" Grid.Row="3" Interval="50"/>
        						<RepeatButton Height="16" Margin="1" x:Name="VerticalSmallIncrease" IsTabStop="False" Template="{StaticResource VerticalIncrementTemplate}" Grid.Row="4" Interval="50"/>
        					</Grid>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
        <Style x:Key="ScrollViewerPepgNew" TargetType="ScrollViewer">
        	<Setter Property="HorizontalContentAlignment" Value="Left"/>
        	<Setter Property="VerticalContentAlignment" Value="Top"/>
        	<Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
        	<Setter Property="Padding" Value="4"/>
        	<Setter Property="BorderThickness" Value="1"/>
        	<Setter Property="BorderBrush">
        		<Setter.Value>
        			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        				<GradientStop Color="#FFA3AEB9" Offset="0"/>
        				<GradientStop Color="#FF8399A9" Offset="0.375"/>
        				<GradientStop Color="#FF718597" Offset="0.375"/>
        				<GradientStop Color="#FF617584" Offset="1"/>
        			</LinearGradientBrush>
        		</Setter.Value>
        	</Setter>
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="ScrollViewer">
        				<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
        					<Grid Background="{TemplateBinding Background}">
        						<Grid.ColumnDefinitions>
        							<ColumnDefinition Width="*"/>
        							<ColumnDefinition Width="Auto"/>
        						</Grid.ColumnDefinitions>
        						<Grid.RowDefinitions>
        							<RowDefinition Height="*"/>
        						</Grid.RowDefinitions>
        						<ScrollContentPresenter Cursor="{TemplateBinding Cursor}" Margin="4,24,4,4" x:Name="ScrollContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}"/>
        						<Rectangle Grid.Column="1" Fill="#FFE9EEF4" Margin="0,321,0,0"/>
        						<ScrollBar Margin="0,-1,-18,-1" x:Name="VerticalScrollBar" Width="18" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" IsTabStop="False" Grid.Column="1" Grid.Row="0" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{TemplateBinding VerticalOffset}" Orientation="Vertical" ViewportSize="{TemplateBinding ViewportHeight}" d:LayoutOverrides="GridBox"/>
        						<ScrollBar Height="48.5" Margin="4,3,4.5,0" x:Name="HorizontalScrollBar" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" IsTabStop="False" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{TemplateBinding HorizontalOffset}" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" VerticalAlignment="Top" Style="{StaticResource ScrollBarTick}" d:LayoutOverrides="Height"/>
        					</Grid>
        				</Border>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
    </UserControl.Resources>

    <Border Height="Auto" Width="Auto" Padding="6,6,6,6" Background="#FFFFFFFF">

		<Grid x:Name="LayoutRoot"  Background="{x:Null}" Height="Auto" Width="Auto">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="48" />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="95" />
				<RowDefinition Height="*" />
			</Grid.RowDefinitions>

			<!-- EPG Header Section -->
			<Grid x:Name="headerGrid" Height="Auto" Grid.ColumnSpan="2">
				<Grid.RowDefinitions>
					<RowDefinition Height="*" />
					<RowDefinition Height="*" />
					<RowDefinition Height="*" />
				</Grid.RowDefinitions>
				<Grid x:Name="EpgTopBar" Grid.Row="0" Margin="0,2,0,2"  HorizontalAlignment="Stretch">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*"/>
						<ColumnDefinition Width="*"/>
						<ColumnDefinition Width="*"/>
					</Grid.ColumnDefinitions>
					<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">

						<Image Width="Auto" Height="Auto" Source="http://localhost:8080/images/epgIcons/epg_buttons_0010_stopwatch-copy-2.png" Stretch="None" Margin="0,0,0,0" />
						<Image Width="Auto" Height="Auto" Source="http://localhost:8080/images/epgIcons/epg_buttons_0011_Guide-copy-2.png" Stretch="None" Margin="0,0,0,0" />
					</StackPanel>
					<Button Grid.Column="2" Content="X" Width="20" Height="Auto" Margin="0,3,2.536,3" HorizontalAlignment="Right" d:LayoutOverrides="GridBox" />
				</Grid>

				<ctl:EpgChannelDateSelector Grid.Row="1" Margin="0,2,0,2"  x:Name="ChannelAndDateSelector" Grid.ColumnSpan="4" HorizontalAlignment="Left"  />

				<ctl:EpgTimeButtonsControl  Grid.Row="2" Margin="0,2,0,2"  x:Name="ButtonsControl" />

			</Grid>
			<!-- ******************************************************************************************************************************* -->
			<!--


        <Grid Grid.Row="1" Grid.Column="0" Margin="0,0,0,2" Background="White">
            <TextBlock Text="0" x:Name="txtOffset" ></TextBlock>
        </Grid>
		
		-->
        
			<!-- EPG ChannelIcon ScrollView -->
			<Grid Grid.Row="1" Grid.Column="0" Background="White" Margin="0,44,8,1">
				<!--<ScrollViewer x:Name="epgIconScrollView" Height="310" Width="50" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,0,0">-->
				<ItemsControl x:Name="epgListIcons" ItemsSource="{Binding Mode=OneWay, Path=Channels}" >
					<ItemsControl.ItemsPanel>
						<ItemsPanelTemplate>
							<StackPanel Orientation="Vertical" />
						</ItemsPanelTemplate>
					</ItemsControl.ItemsPanel>
					<ItemsControl.ItemTemplate>
						<DataTemplate>
							<Border Width="Auto" Height="50" Background="#FFE0E0E0">
								<Grid Height="50" Background="{StaticResource greyFadeVert2}" Width="Auto" Margin="0,1,1,0">
									<Image Source="{Binding Mode=OneWay, Path=Icon}" Width="36" Height="36" />
								</Grid>
							</Border>
						</DataTemplate>
					</ItemsControl.ItemTemplate>
				</ItemsControl>
				<!--</ScrollViewer>-->
			</Grid>

			<!-- EPG Schedule Scrollview -->
			<Grid Grid.Row="1" Grid.Column="1" Background="White">
				<ScrollViewer x:Name="epgScrollView"  HorizontalAlignment="Stretch" 
					VerticalAlignment="Stretch" VerticalScrollBarVisibility="Hidden"   
					HorizontalScrollBarVisibility="Visible" Margin="-7.75,0.5,7.75,-0.5"  Style="{StaticResource ScrollViewerPepgNew}"  >
					<StackPanel x:Name="allOfEpgWidth" Background="#FFE8E8E8" Margin="0,0,0,0">
						<Canvas Height="30" x:Name="timeTitles" Margin="0,0,0,0" Visibility="Visible" Width="3000" >
							<Canvas.Background>
								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
									<GradientStop Color="LightGray"/>
									<GradientStop Color="#FFFFFFFF" Offset="1"/>
								</LinearGradientBrush>
							</Canvas.Background>
							<Image Canvas.Top="15" Canvas.Left="0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Height="10" Source="http://localhost:8080/images/epgIcons/day_timeline.png" Stretch="Fill" x:Name="hticks" IsHitTestVisible="False"/>
						</Canvas>

						<!-- Dynamic insertion of epg entries here -->
						<ItemsControl x:Name="epgListItems" ItemsSource="{Binding Path=Channels}" >
							<ItemsControl.ItemTemplate>
								<DataTemplate>
									<Grid Height="50">
										<ItemsControl x:Name="epgChannelItems" ItemsSource="{Binding Path=Schedules}" >
											<ItemsControl.ItemsPanel>
												<ItemsPanelTemplate/>
											</ItemsControl.ItemsPanel>
											<ItemsControl.ItemTemplate >
												<DataTemplate>
													<Canvas>
														<Button 
															Height="50" Canvas.Top="0" Style="{StaticResource EPGButton}"
															Canvas.Left="{Binding Converter={StaticResource posCalc}, Path=start}" 
															Width="{Binding Converter={StaticResource widthCalc}, Path=Duration}"
															Background="{StaticResource greyFadeVert2}" Foreground="Black" 
															ToolTipService.ToolTip="Program X">
															<StackPanel>
																<TextBlock Text="{Binding Converter={StaticResource timeCalc}, Path=start}"/>
																<TextBlock Text="Le seigneur des Anneaux"/>
															</StackPanel>
														</Button>
													</Canvas>
												</DataTemplate>
											</ItemsControl.ItemTemplate>
										</ItemsControl>
									</Grid>
								</DataTemplate>
							</ItemsControl.ItemTemplate>
						</ItemsControl>
					</StackPanel>
				</ScrollViewer>
			</Grid>
		</Grid>

	</Border>

</UserControl>
